//供应商

<template>
  <div class="">
    <div id="query">
      <label for="">供应商编号: <input type="text" v-model="title" /></label>
      <label for="">供应商名称: <input type="text" v-model="founder" /></label>
      <label for=""
        >社会信用代码: <input type="text" v-model="founder"
      /></label>
      <div id="kuang">
        <label for="">法人: <input type="text" v-model="founder" /></label>
        <label for="">联系方式: <input type="text" v-model="founder" /></label>
        <label for=""
          >创建日期：
          <el-date-picker
            v-model="value1"
            type="date"
            placeholder="选择日期"
            :editable="true"
          >
          </el-date-picker>
        </label>
      </div>

      <div id="btn">
        <button id="first-btn" @click="query">查询</button>
        <button id="added" @click="add">新增社工班组</button>
        <button id="last-btn" @click="reset">重置</button>
      </div>
    </div>
    <div class="inputDeep">
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column type="index" label="序号" style="width: 60px">
        </el-table-column>
        <el-table-column prop="title" label="供应商名称"> </el-table-column>
        <el-table-column prop="title" label="供应商编号"> </el-table-column>
        <el-table-column prop="title" label="统一社会信用代码">
        </el-table-column>
        <el-table-column prop="title" label="法人"> </el-table-column>
        <el-table-column prop="title" label="联系方式"> </el-table-column>
        <el-table-column prop="title" label="关联合同"> </el-table-column>

        <el-table-column prop="founder" label="创建人"> </el-table-column>
        <el-table-column prop="data" label="创建日期"> </el-table-column>
        <el-table-column prop="operation" label="操作">
          <template>
            <el-button @click="edit" type="text" size="small">编辑</el-button>
            <el-button type="text" size="small" @click="delect">删除</el-button>
            <el-button type="text" size="small" @click="particulars"
              >详情</el-button
            >
          </template>
        </el-table-column>
      </el-table>
      <div id="page">
        <el-pagination
          align="right"
          background
          layout="prev, pager, next"
          :total="50"
          style="margin-top: 30px"
          @current-change="newpage"
          :current-page="currentPage"
        >
        </el-pagination>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  data() {
    return {
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now();
        },
      },
      total: 1,
      currentPage: 1,
      options: [],
      value: "",
      value1: "",
      tableData: [
        {
          num: "1",
          title: "1",
          founder: "1",
          data: "1",
        },
      ],
      num: "",
      title: "",
      founder: "",
      data: "",
      operation: "",
    };
  },
  computed: {},
  watch: {},
  methods: {
    edit() {},
    delect() {},
    add() {},
    query() {
      this.$axios
        .get("http://47.100.30.10:8080/gys/findGysList", {
          params: {
            currentPage: this.currentPage,
            pageSize: 10,
          },
        })
        .then((data) => {
          console.log(data);
        });
    },
    particulars() {
      this.$router.push("/particulars");
    },
    reset() {
      this.title = "";
      this.time = "";
      this.founder = "";
      this.project = "";
      this.value = "";
      this.value1 = "";
      this.show();
    },
    //渲染
    show() {
      console.log(this.currentPage);
      this.$axios
        .post("http://47.100.30.12:8080/gys/findGysMh", {
          data: {
            currentPage: this.currentPage,
            pageSize: 10,
          },
        })
        .then((data) => {
          console.log(data);
          this.tableData = data.data.data;
        });
    },
    //当前页
    newpage(index) {
      this.currentPage = index;
      this.show();
    },
  },
  created() {},
  mounted() {
    this.show();
  },
};
</script>
<style scoped>
#kuang {
  margin-left: 55px;
}
label {
  margin-left: 20px;
}
input {
  margin-bottom: 20px;
  height: 25px;
}
#btn {
  margin: 20px 0;

  /* padding-left: 56px; */
}
button {
  height: 30px;
}
#last-btn {
  width: 60px;

  background-color: rgb(70, 167, 247);
  color: white;
  border: 1px rgb(70, 167, 247) solid;
}
#first-btn {
  width: 60px;
  background-color: transparent;
  border: 1px solid black;
  margin-right: 20px;
}
#added {
  margin-top: 20px;
  margin-bottom: 30px;
  width: 100px;
  height: 30px;
  background-color: transparent;
  border: 1px solid black;
  margin-right: 20px;
}
.inputDeep >>> .el-table .cell {
  padding: 0 0;
  text-align: center;
}
.inputDeep >>> .el-table {
  font-size: 12px;
}
.inputDeep >>> .el-table .el-table__cell {
  padding: 5px 0;
}
</style>